﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Collections.ObjectModel;

namespace Barbar.MapReport.DataSource.Entities {
  [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix"), XmlTypeAttribute(TypeName = "Region", Namespace = Constants.DataSourceXmlNamespace)]
  public class RawPolygon : Collection<RawPolyline> {
    internal Polygon ToPolygon() {
      Collection<Polyline> polylines = new Collection<Polyline>();
      foreach (RawPolyline polyline in this)
        polylines.Add(polyline.ToPolyline());

      return new Polygon(polylines);
    }
  }
}
